home *** CD-ROM | disk | FTP | other *** search
- unit Server_TLB;
-
- // ************************************************************************ //
- // WARNING //
- // ------- //
- // The types declared in this file were generated from data read from a //
- // Type Library. If this type library is explicitly or indirectly (via //
- // another type library referring to this type library) re-imported, or the //
- // 'Refresh' command of the Type Library Editor activated while editing the //
- // Type Library, the contents of this file will be regenerated and all //
- // manual modifications will be lost. //
- // ************************************************************************ //
-
- // PASTLWTR : $Revision: 1.11.1.63 $
- // File generated on 31/08/98 09:25:33 from Type Library described below.
-
- // ************************************************************************ //
- // Type Lib: D:\BUG\CORBA\Server.tlb
- // IID\LCID: {6B0BEBC0-40B4-11D2-8684-0020182CD6A0}\0
- // Helpfile:
- // HelpString: Server Library
- // Version: 1.0
- // ************************************************************************ //
-
- interface
-
- uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL, SysUtils, CORBAObj, OrbPas, CorbaStd;
-
- // *********************************************************************//
- // GUIDS declared in the TypeLibrary. Following prefixes are used: //
- // Type Libraries : LIBID_xxxx //
- // CoClasses : CLASS_xxxx //
- // DISPInterfaces : DIID_xxxx //
- // Non-DISP interfaces: IID_xxxx //
- // *********************************************************************//
- const
- LIBID_Server: TGUID = '{6B0BEBC0-40B4-11D2-8684-0020182CD6A0}';
- IID_ITest: TGUID = '{6B0BEBC1-40B4-11D2-8684-0020182CD6A0}';
- CLASS_Test: TGUID = '{6B0BEBC3-40B4-11D2-8684-0020182CD6A0}';
- type
-
- // *********************************************************************//
- // Forward declaration of interfaces defined in Type Library //
- // *********************************************************************//
- ITest = interface;
- ITestDisp = dispinterface;
-
- // *********************************************************************//
- // Declaration of CoClasses defined in Type Library //
- // (NOTE: Here we map each CoClass to its Default Interface) //
- // *********************************************************************//
- Test = ITest;
-
-
- // *********************************************************************//
- // Interface: ITest
- // Flags: (4416) Dual OleAutomation Dispatchable
- // GUID: {6B0BEBC1-40B4-11D2-8684-0020182CD6A0}
- // *********************************************************************//
- ITest = interface(IDispatch)
- ['{6B0BEBC1-40B4-11D2-8684-0020182CD6A0}']
- function Get_DateAndTime: TDateTime; safecall;
- property DateAndTime: TDateTime read Get_DateAndTime;
- end;
-
- // *********************************************************************//
- // DispIntf: ITestDisp
- // Flags: (4416) Dual OleAutomation Dispatchable
- // GUID: {6B0BEBC1-40B4-11D2-8684-0020182CD6A0}
- // *********************************************************************//
- ITestDisp = dispinterface
- ['{6B0BEBC1-40B4-11D2-8684-0020182CD6A0}']
- property DateAndTime: TDateTime readonly dispid 1;
- end;
-
- TTestStub = class(TCorbaDispatchStub, ITest)
- public
- function Get_DateAndTime: TDateTime; safecall;
- end;
-
- TTestSkeleton = class(TCorbaSkeleton)
- private
- FIntf: ITest;
- public
- constructor Create(const InstanceName: string; const Impl: IUnknown); override;
- procedure GetImplementation(out Impl: IUnknown); override; stdcall;
- published
- procedure Get_DateAndTime(const InBuf: IMarshalInBuffer; Cookie: Pointer);
- end;
-
- CoTest = class
- class function Create: ITest;
- class function CreateRemote(const MachineName: string): ITest;
- end;
-
- TTestCorbaFactory = class
- class function CreateInstance(const InstanceName: string): ITest;
- end;
-
- implementation
-
- uses ComObj;
-
- { TTestStub }
-
- function TTestStub.Get_DateAndTime: TDateTime;
- var
- OutBuf: IMarshalOutBuffer;
- InBuf: IMarshalInBuffer;
- begin
- FStub.CreateRequest('Get_DateAndTime', True, OutBuf);
- FStub.Invoke(OutBuf, InBuf);
- Result := TDateTime(InBuf.GetDouble);
- end;
-
- { TTestSkeleton }
-
- constructor TTestSkeleton.Create(const InstanceName: string; const Impl: IUnknown);
- begin
- inherited;
- inherited InitSkeleton('Test', InstanceName, 'IDL:Server/ITest:1.0', tmMultiThreaded, True);
- FIntf := Impl as ITest;
- end;
-
- procedure TTestSkeleton.GetImplementation(out Impl: IUnknown);
- begin
- Impl := FIntf;
- end;
-
- procedure TTestSkeleton.Get_DateAndTime(const InBuf: IMarshalInBuffer; Cookie: Pointer);
- var
- OutBuf: IMarshalOutBuffer;
- Retval: TDateTime;
- begin
- Retval := FIntf.Get_DateAndTime;
- FSkeleton.GetReplyBuffer(Cookie, OutBuf);
- OutBuf.PutDouble(Double(Retval));
- end;
-
- class function CoTest.Create: ITest;
- begin
- Result := CreateComObject(CLASS_Test) as ITest;
- end;
-
- class function CoTest.CreateRemote(const MachineName: string): ITest;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_Test) as ITest;
- end;
-
- class function TTestCorbaFactory.CreateInstance(const InstanceName: string): ITest;
- begin
- Result := CorbaFactoryCreateStub('IDL:Server/TestFactory:1.0', 'Test',
- InstanceName, '', ITest) as ITest;
- end;
-
- initialization
- CorbaStubManager.RegisterStub(ITest, TTestStub);
- CorbaInterfaceIDManager.RegisterInterface(ITest, 'IDL:Server/ITest:1.0');
- CorbaSkeletonManager.RegisterSkeleton(ITest, TTestSkeleton);
-
- end.
-